//
//  C_JixieCell_2.m
//  Estate
//
//  Created by heyong on 16/6/13.
//  Copyright © 2016年 ttsx. All rights reserved.
//

#import "C_JixieCell_2.h"

@implementation C_JixieCell_2
- (void)setIsEdit:(BOOL)isEdit{
    self.text1.userInteractionEnabled=isEdit;
    self.text2.userInteractionEnabled=isEdit;
    self.text3.userInteractionEnabled=isEdit;
    self.text4.userInteractionEnabled=isEdit;
    self.text5.userInteractionEnabled=isEdit;

}
- (void)awakeFromNib {
    [super awakeFromNib];
    self.selectionStyle=UITableViewCellSelectionStyleNone;
    [self setTextClolor:UIColorFromRGB(0x797979)];
    [self setLineColor:[UIColor colorWithRed:0.97 green:0.97 blue:0.97 alpha:1.00]];
 
}
- (void)setLineColor:(UIColor *)color{
    self.view1.backgroundColor=color;
    self.view2.backgroundColor=color;
    self.view3.backgroundColor=color;
    self.view4.backgroundColor=color;
}

-(void) setTextClolor:(UIColor *)color{
    self.title1.textColor=color;
    self.title2.textColor=color;
    self.title3.textColor=color;
    self.title4.textColor=color;
    self.title5.textColor=color;
    self.title6.textColor=color;
    self.tai1.textColor=color;
    self.tai2.textColor=color;
    self.tai3.textColor=color;
    self.tai4.textColor=color;
    self.tai5.textColor=color;

}

- (void)configWithPlaceholder:(NSString *)phStr1 andValue1:(NSString *)valueStr1 andValue2:(NSString *)valueStr2 andValue3:(NSString *)valueStr3 andValue4:(NSString *)valueStr4 andValue5:(NSString *)valueStr5{
    self.text1.placeholder=phStr1;
    self.text2.placeholder=phStr1;
    self.text3.placeholder=phStr1;
    self.text4.placeholder=phStr1;
    self.text5.placeholder=phStr1;

    self.text1.text=valueStr1;
    self.text2.text=valueStr2;
    self.text3.text=valueStr3;
    self.text4.text=valueStr4;
    self.text5.text=valueStr5;
    
    self.text1.delegate=self;
    self.text2.delegate=self;
    self.text3.delegate=self;
    self.text4.delegate=self;
    self.text5.delegate=self;
    
    self.text1.keyboardType=UIKeyboardTypeNumberPad;
    self.text2.keyboardType=UIKeyboardTypeNumberPad;
    self.text3.keyboardType=UIKeyboardTypeNumberPad;
    self.text4.keyboardType=UIKeyboardTypeNumberPad;
    self.text5.keyboardType=UIKeyboardTypeNumberPad;

}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    // Configure the view for the selected state
}

- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{
    //   限制苹果系统输入法  禁止输入表情
    if ([[[UITextInputMode currentInputMode]primaryLanguage] isEqualToString:@"emoji"]) {
        return NO;
    }
   
    return YES;
}

- (IBAction)text1:(UITextField *)sender {
    if(self.text1Block){
        self.text1Block(sender.text);
    }
}

- (IBAction)text2:(UITextField *)sender {
    if(self.text2Block){
        self.text2Block(sender.text);
    }
}

- (IBAction)text3:(UITextField *)sender {
    if(self.text3Block){
        self.text3Block(sender.text);
    }
}

- (IBAction)text4:(UITextField *)sender {
    if(self.text4Block){
        self.text4Block(sender.text);
    }
}

- (IBAction)text5:(UITextField *)sender {
    if(self.text5Block){
        self.text5Block(sender.text);
    }
}
@end
